//
//  YJWLoginRegisterController.m
//  百思不得骑姐
//
//  Created by YJW on 16/10/30.
//  Copyright © 2016年 yijiang. All rights reserved.
//

#import "YJWLoginRegisterController.h"

@interface YJWLoginRegisterController ()

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *loginLeftMargin;

@end

@implementation YJWLoginRegisterController

- (IBAction)cancel:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (IBAction)registerORLogin:(UIButton*)btn {
    //退出键盘
    [self.view endEditing:YES];
    
    if (self.loginLeftMargin.constant == 0) {   //切换到注册
        btn.selected = YES;
        self.loginLeftMargin.constant = -self.view.width;
    }else{  //切换到登录
        btn.selected = NO;
        self.loginLeftMargin.constant = 0;
    }
    
    [UIView animateWithDuration:0.1 animations:^{
        [self.view layoutIfNeeded];
    }];
}

- (void)viewDidLoad {
    [super viewDidLoad];

}

-(UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}
@end
